#pragma once
#include "Utility/Algebra/Vector3D.h"
#include "DataStructure/Common/DataStructureExport.h"
#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Common/SetBase.h"
#include "DataStructure/Input/Load/LoadTypes.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
struct DECLSPEC PLOAD4Data : public SetBase
{
    static SG::DataStructure::FEM::LoadType GetType ()
    {
        return SG::DataStructure::FEM::LoadType::LOAD_PLOAD4;
    };
    /**
     * @brief   获取矢量方向 
     * 
     * @author   wanghuan
     * @date     2025.02.19
     */
    SG::Algebra::Vector3D GetDirection () const;

    SG::DataStructure::Common::Id   m_eId      = 0;        ///< 单元Id
    SG::DataStructure::Common::Real m_P[4]     = { 0.0 };  ///< 载荷值
    SG::DataStructure::Common::Id   m_G1       = 0;        /// 连接到面角的栅格点的标识号
    SG::DataStructure::Common::Id   m_G34      = 0;        /// 单元面拐角处的每单位表面积（压力）载荷
    SG::DataStructure::Common::Id   m_cId      = 0;        ///< 坐标系Id
    SG::DataStructure::Common::Real m_N[3]     = { 0.0 };  ///< 在 CID 定义的坐标系中测量的矢量分量
    char                            m_sorl[8]  = { 0 };    /// 面载荷或线载荷
    char                            m_ldir[8]  = { 0 };    /// 线载荷
    SG::DataStructure::Common::Id   m_domainId = 0;
};

inline SG::Algebra::Vector3D PLOAD4Data::GetDirection () const
{
    return SG::Algebra::Vector3D{m_N[0], m_N[1], m_N[2]};
}

using PLOAD4Array = std::vector<SG::DataStructure::FEM::PLOAD4Data>;
DECLSPEC bool operator== (const PLOAD4Data& a, const PLOAD4Data& b);
SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE